<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title>欣和爱生活食育体验馆</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1  user-scalable=no" />
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl?>/css/ui-box.css">
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl?>/css/css/frozen.css">
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/js/area.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/js/jquery.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/js/layer/layer.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->baseUrl?>/editor/kindeditor-min.js"></script>
 
        <style>
        .back {
        background-image: url('<?php echo Yii::app()->baseUrl?>/images/back.png');
        min-height: 1.5em;
        }
         .upload {
        background-image: url('<?php echo Yii::app()->baseUrl?>/images/upload.png');
        min-height: 5em;
        width: 100%;
        }
         /* 兼容iphone5 */
       @media (device-height:568px) and (-webkit-min-device-pixel-ratio:2) {
             .abc2 {
                background-image: url('<?php echo Yii::app()->baseUrl?>/images/logo2.jpg');
                min-height: 9em;
                width: 100%;
              }
        }
       
        .ub-img {
        -webkit-background-size: contain;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        }
        
      
        body{
            -moz-user-select: none; /*火狐*/
            -webkit-user-select: none;  /*webkit浏览器*/
            -ms-user-select: none;   /*IE10*/
            -khtml-user-select: none; /*早期浏览器*/
            user-select: none;
            
            font: normal 16px Arial,"Microsoft YaHei";
            background-color: #fbeedd;
            max-width: 640px;
            margin: 0 auto;
            min-height: 100%;
            color:#62240f;
            
         }
         
         .content{
             margin-top:5em;
             padding-left:2em;
         }
         .text{
             -webkit-appearance:none;
             outline:none;
             border-radius:6px;outline:none;cursor:pointer;text-indent:6px;
             border:none;
             height:20px;
             
         }

         .ui-header {
            top: 0;
            height: 45px;
            line-height: 45px;
            position: fixed;
            width: 100%;
            z-index: 100;
            left: 0;
            background-color: #f15c22;
          }
          .top{
              margin-top:1.5em;
          }
          .col{
              width:4em;
          }
          

           select{
            border:none;
            -webkit-appearance: none;
            width: 80px;
            height: 20px;
            overflow: hidden;
            font-size: 12px;
            background: url('<?php echo Yii::app()->baseUrl?>/images/xiala.png') no-repeat right white;

          }
          
          .ui-radio input:checked:after {
                content: '';
                display: block;
                width: 12px;
                height: 12px;
                background: #f05b21;
                border-radius: 7px;
                position: absolute;
                left: 5px;
                top: 5px;
          }
          
          .ui-radio input:before {
                content: '';
                display: block;
                width: 20px;
                height: 20px;
                border: 1px solid #dfe0e1;
                border-radius: 13px;
                -webkit-background-clip: padding-box;
                background-clip: padding-box;
                position: absolute;
                left: 0px;
                top: 0;
              }
              
              
              .ui-btn, .ui-btn-lg, .ui-btn-s {
                    height: 30px;
                    line-height: 30px;
                    padding: 0 31px;
                    
             }
             
             .ui-btn-danger {
                background-color: #f15c22;
                background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.5, #f15c22), to(#f15c22));
                color: white;
                border-color: #f43d30;
                -webkit-background-clip: padding-box;
                background-clip: padding-box;
              }
              
            .input2{
            -webkit-appearance:none;  
            color:black;
            border-bottom:1px solid #62240f; /* 下划线效果 */
            border-top:0px;
            border-left:0px;
            border-right:0px;
            background-color:transparent; /* 背景色透明 */
            text-align:center;
            }
            
             
            .font12{
                font-size:14px !important;
            }
            
            .uinn-a2 {
            padding: 0.35em 0;
            }
            .t-wh {
            color: white;
            }
            .c-org {
            background-color: #f15c22;
            }
            .tx-c {
            text-align: center;
            }
            .uc-a1 {
            -webkit-border-radius: 0.3em;
            border-radius: 0.3em;
            }
            
             .touch {
            background-image: url('<?php echo Yii::app()->baseUrl?>/images/touch.gif');
            min-height: 5em;
            width:8em;
            }
            
           
             .bottom {
            background-image: url('<?php echo Yii::app()->baseUrl?>/images/bottom.png');
            min-height: 45em;
            width: 100%;
            }
            
            .errorSummary{
                color:red;
                text-align:center;
                margin-top:1em;
            }
            
            .errorMessage{
                 color:red;
            }
            
            .btn-1{
                -webkit-appearance:none;
                 background-color: #f15c22;
                 border:1px #f15c22 solid;
                 color:white;
            }
            .div_filter{  
                margin-top: 0.5em;               
                margin-left: -1em;
                margin-right: 0.5em;
            }
        </style>
        <script>

        function next(val){
              $("#Party_next").val("50");
            for(var i=1;i<5;i++){
                if(i==val){
                document.getElementById("div"+i).style.display="block"
                 }
                else{
                 document.getElementById("div"+i).style.display="none"   
                 }
            }
        }
        //团体报名
        function tuanti(){
             document.getElementById("tuanti_btn").style.display="block"
             document.getElementById("tuanti_confirm").style.display="block"
        }
     
        </script>
         <script>
        $(function () {
             $("#Party_username_em_")
        });

        KindEditor.ready(function(K) {
                var uploadbutton = K.uploadbutton({
                        button : K('#uploadButton')[0],
                        fieldName : 'imgFile',
                        filedId:"imgFile",
                        url : '<?php echo Yii::app()->baseUrl?>/editor/php/upload_json.php?dir=image',
                        afterUpload : function(data) {
                                if (data.error === 0) {
                                        var url = K.formatUrl(data.url, 'absolute');
                                        document.getElementById("preview2").style.display="none";
                                        document.getElementById("preview").style.display="block"
                                        document.getElementById("preview").src=url;
                                        K('#Party_head_image').val(url);
                                } else {
                                        alert(data.message);
                                }
                        },
                        afterError : function(str) {
                                alert('自定义错误信息: ' + str);
                        }
                });
                uploadbutton.fileBox.change(function(e) {
                        uploadbutton.submit();
                });
        });
	
        
        </script>
    </head>
    <body class='all ub-img1' >
    <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'party-form',
            'enableClientValidation' => false,//是否开启客户端验证
       // 'enableAjaxValidation' => true,//是否开启ajax验证
        'clientOptions' => array(
            //'validateOnchange' => true,//内容改变时ajax验证
            'validateOnSubmit' => true,//提交时ajax验证
            ),
         'htmlOptions'=>array('class'=>'ajax_form'),
    )); ?>
 
	 <div id="div1" >

              <div>
               <image src=" <?php echo Yii::app()->baseUrl?>/images/index1.jpg" width="100%" />  
             </div>
            <div style="text-align: center;position: relative;">
                
                <div style="position: absolute;left: 36%;" >
                    <div style="text-align: center;" onclick="geren()">
                        <image src="<?php echo Yii::app()->baseUrl?>/images/geren.png" width="100em" />                
                    </div>
                    <div style="text-align: center; margin-top: 0.5em" onclick="tuanti()">
                        <image src="<?php echo Yii::app()->baseUrl?>/images/tuanti.png" width="100em" />                        
                    </div>
<!--                    <div style="text-align: center; margin-top: -3em">
                       <image src="<?php echo Yii::app()->baseUrl?>/images/touch.gif"  width="150em"/> 
                    </div>                    -->
                </div> 
                <div style="position: absolute;left: 36%;margin-top: 3.3em; margin-left: 7em;">
                    <a style="font-size: 12px;" href="javascript:void(0)" onclick="next(4)"><u>团体报名流程</u></a>
                </div>                
<!--                <div style="position: absolute;left: 70%;margin-top: 4.5em; font-size: 10px;">
                        <a href="javascript:void(0)" onclick="next(4)"><u>团体报名流程</u></a>
                </div>-->
                <div id="tuanti_btn" style="display: none;position: absolute;left: 10%;margin-top: 5em;">
                    <span style=" color: #000000;font-size: 15px;">请输入您的团体邀请码：</span>
                    <input id="invitation_code" type="text" style=" width: 5em; height: 1.5em;"/>
                </div>
                <div id="tuanti_confirm" onclick="ajaxtuanti()" style="display: none; position: absolute;left: 40%;margin-top: 7em;">
                    <!--<image src="<?php echo Yii::app()->baseUrl?>/images/u13.png"width="70em" >-->
                    <image id="u13_img" class="img " src="<?php echo Yii::app()->baseUrl?>/images/u13.png" width="70em"/>
                    <!-- Unnamed () -->
                    <div style=" margin-top: -1.9em;">
                        <p><span style=" color: #FF6600;">确认</span></p>
                    </div>
                </div>  
                <div id="tuanti_error_empt" style="display: none;position: absolute;left: 40%;margin-top: 9em;">
                    <div>
                        <span style=" color: #FF0000;font-size: 10px;">请输入邀请码！</span>
                    </div>                  
                </div>
<!--                <div id="tuanti_error_msg" style="position: absolute;left: 25%;margin-top: 9em;">
                    <div>
                        <span style=" color: #FF0000;font-size: 10px;">邀请码输入错误，请重输入！</span>
                    </div>
                    <div>
                         <span style=" color: #FF0000;font-size: 10px;">如您是个人用户，请选择个人报名</span>
                    </div>
                    
                </div>                -->
                
            </div>
                <div style="text-align: center; margin-top: -0.5em;">
                   <image src=" <?php echo Yii::app()->baseUrl?>/images/index2.jpg" width="100%" />  
                 </div>  
             
        </div>
        <!--团体报名描述-->
        <div id="div4" style="display: none" >
            <header class="ui-header" >
                
                <div class="ub ub-ac" >
                <div class=""style="color: white;min-width: 4em" onclick="next(1)">
                    <div class="back ub-img"></div>
                </div>
                <div class="ub-f1"style="color: white;text-align: center">团体报名流程介绍</div>
                
                <div class=""style="color: white;min-width: 4em">
                </div>
                    
                </div>
            </header>
            <div style="margin-top: 2.9em;">
               <image src=" <?php echo Yii::app()->baseUrl?>/images/webwxgetmsgimg.jpg" width="100%" />  
            </div>
        </div>
        
        <div id="div2" style="display: none" >
            
               <header class="ui-header" >
                
                <div class="ub ub-ac" >
                <div class=""style="color: white;min-width: 4em" onclick="next(1)">
                    <div class="back ub-img"></div>
                </div>
                <div class="ub-f1"style="color: white;text-align: center">基本信息</div>
                
                <div class=""style="color: white;min-width: 4em">
                </div>
                    
                </div>
            </header>
            
        <div class="content">
            

            
            <div class="ub ub-ac top">
                <div class='ub ub-ver ub-f1'>
                    
                  
                    
                    <div class='ub '>
                        <div class="col">姓名</div>
                         <div class="ub-f1 " style="margin-left:1em">
                             <?php echo $form->textField($model,'username',array('class'=>'text','style'=>"width:80px")); ?>
                            <div class="errorMessage" id="Party_username_em_" ></div>	
                         </div>

                    </div>
                    
                  
                    <div class='ub top'>
                                <div class="col">性别</div>
                                <div class="ub " style="margin-left:1em">
                                    <input id="ytParty_sex" type="hidden" value="" name="Party[sex]">    
                                    <label class="ui-radio" for="radio">
                                        <input id="Party_sex_0" value="男" type="radio" name="Party[sex]" checked=>男
                                    </label>
                                    <label class="ui-radio" for="radio">
                                        <input id="Party_sex_1" value="女" type="radio" name="Party[sex]">女
                                    </label> 
                                   
                                </div>
                      </div>
                    
                     
                </div>
                
                



                
                <div style="padding-right:1em">
                    <div style=" display: none">
                         <?php echo $form->hiddenField($model,'head_image');?> 
                          <input class="ke-input-text" type="text" id="url" value="" readonly="readonly" /> <input type="button" id="uploadButton" value="Upload" />
                    </div>
                    <input type="file" name="file" id="doc" style="width:150px;display: none" onchange="img_load()" >
                        <image id="preview2" src="<?php echo Yii::app()->baseUrl?>/images/top-img.png" onclick="document.getElementsByName('imgFile')[0].click(); "  width="80px" height="80px" style="">
                        <image id="preview" src="<?php echo Yii::app()->baseUrl?>/images/top-img.png" onclick="document.getElementsByName('imgFile')[0].click(); "  width="80px" height="80px" style="border-radius:46px;display:none">
                    </a>
                        
                </div>

             </div>
            
             <div class="ub ub-ac top">
            <div class="col">电话</div>
            <div class="ub-f1 " style="margin-left:1em">
                 <?php echo $form->textField($model,'phone',array('class'=>'text','style'=>"width: 70%;")); ?>
                 <div class="errorMessage" id="Party_phone_em_" ></div>
            </div>
            </div>
            
            <div class="ub ub-ac  top">
             <div class="col">验证码</div>
             <div>
            <div class="ub-f1 ub ub-ac" style="margin-left:1em">
                <div>
                     <?php echo $form->textField($model,'vcode',array('class'=>'text','style'=>"width: 80px;")); ?>
                </div>
                <input id="click_post" class="btn-1" type="button" value="获取验证码" onclick="smspost()">
            </div>
                    <div style="margin-left:1em" class="errorMessage " id="Party_vcode_em_" ></div>
                 </div>
           
            
             
                  
            </div>
       
            
          <div class="ub ub-ac top">
            <div class="col">单位</div>
            <div class="ub-f1 " style="margin-left:1em">
                 <?php echo $form->textField($model,'company',array('class'=>'text','style'=>"width: 70%;")); ?>
                     <div class="errorMessage" id="Party_company_em_" ></div>
            </div>
            </div>
            
            <div class="ub ub-ac top">
            <div class="col">身份证</div>
            <div class="ub-f1 " style="margin-left:1em">
                 <?php echo $form->textField($model,'code',array('class'=>'text','style'=>"width: 70%;")); ?>
                <div class="errorMessage" id="Party_code_em_" ></div>
            </div>
            </div>
           
            
            <div class="ub ub-ac top" style="padding-right:2em;">
            <div style="background-color: #fdf8f2;font-size: 12px;border: 1px #f5956d solid; border-radius:5px;">
                <div style="margin:1em 1em 1em 1em">
                备注：为保证所有参观体验人员的安全，此次体验会为大家购买公众责任保险，身份证填写即为购买保险所需，请务必填写正确信息
                </div>
            </div>
            </div>
            
            <div class="ub ub-ac top">
            <div class="col">地址</div>
            <div class="ub-f1 " style="margin-left:1.5em">
              <?php echo $form->dropDownList($model,'province',array('0'=>'请选择')); ?> 
                省/直辖市
                <div class="errorMessage" id="Party_province_em_" ></div>
                </br>
              <?php echo $form->dropDownList($model,'city',array('0'=>'请选择')); ?> 市
               <div class="errorMessage" id="Party_city_em_" ></div>
              </br>
              <?php echo $form->dropDownList($model,'area',array('0'=>'请选择')); ?> 县/市/区
               <div class="errorMessage" id="Party_area_em_" ></div>
            </div>
            </div>
           <script type="text/javascript">_init_area();</script>
            <div class="ub ub-ac top">
            <div class="col">详细地址</div>
            <div class="ub-f1 " style="margin-left:1em">
                <?php echo $form->textField($model,'address',array('class'=>'text','style'=>"width: 70%;")); ?>
                 <div class="errorMessage" id="Party_address_em_" ></div>
            </div>
            </div>
            
            

        </div>    
            <input id="Party_next" type="hidden" value="50" name="Party[next]">    
            <div class="errorSummary" id="errorSummary">
                 
              </div>
            
            <div class="ub ub-pc top" style="margin-bottom: 2em;">
                <!--
                <div    onclick="next(3)" style="width:30%"  class="uinn-a2 btn_hei1 c-org uc-a1 t-wh tx-c">下一步</div>
                -->
                  <?php
                       echo CHtml::ajaxSubmitButton('下一步', CHtml::normalizeUrl(array('index')), array(
                            
                           'beforeSend'=>'js:loadding()',       
                           'type' => 'POST',
                           'data' => 'js:jQuery(this).parents("form").serialize()+"&isAjaxRequest=1"',
                           'success' =>
                           'function(data){
                               //alert(data);
                                  }'
                               ), array(
                            'id' => 'ajaxSubmit',
                            'name' => 'ajaxSubmit',
                            'class'=>'btn-1',
                            'style'=>'width:170px;height:32px;',
                           

                       ));
                       ?>
                
                
            </div>

        </div>
        
          <div id="div3"  style="display: none">
              
              
              <header class="ui-header ">
                    <div class="ub ub-ac" >
                        <div class=""style="color: white;min-width: 4em" onclick="next(2)">
                        <div class="back ub-img"></div>
                    </div>
                    <div class="ub-f1"style="color: white;text-align: center">活动信息</div>

                    <div class=""style="color: white;min-width: 4em">
                    </div>

                    </div>
                </header>
              
              <div class="content">

                   <div class="ub ub-ac top">
                    <div >是否携带儿童</div>
                   </div>
                   <div class='ub top'>
                                <div class="ub ">
      
                                    <input id="Party_is_children" type="hidden" value="" name="Party[is_children]">    
                                    <label class="ui-radio" for="radio">
                                        <input type="radio" onchange="addListDefault()"  name="Party[is_children]" value="1" id="Party_is_children_1"  checked="checked">是
                                    </label>
                                    
                                </div>
                           <div class="ub-f1 " style="margin-left:2em">
                               <?php echo $form->textField($model,'children_num',array('class'=>'input2','style'=>"width: 100px;")); ?>个
                               <div class="errorMessage" id="Party_children_num_em_" ></div>
                           </div>
                    </div>

                   <div id="ch_list"></div>
                   
                   <div class="errorMessage" id="Children_username_em_" style="margin-top: 1em"></div>
                   
                   <div id="addBtn">
                    <div class="ub ub-ac top" >
                      <div  onclick="addList()" style="width:90px;" class="btn_hei1 c-org uc-a1 t-wh tx-c">点击增加</div>
                    </div>
                          
                   </div>

                  
                   <div class='ub top' >
                                <div class="ub ">
                                    <label class="ui-radio" for="radio">
                                        <input type="radio" onchange="clearc()"  name="Party[is_children]" value="2" id="Party_is_children_2" >否
                                    </label>
                                </div>
                   </div>
                   
                   
                   <div class='ub top'>
                             <div class='ub '>
                            <div class="col">体验时间</div>
                            <div  style="margin-left:0.5em"> 
                                <?php 
                                $invitation_code=0;
                                if (!empty(Yii::app()->session['invitation_code'])){
                                    $invitation_code=Yii::app()->session['invitation_code'];
                                }
                                if ($invitation_code>0){
                                    $pmodel=  ActivityDetail::model()->findAll("id=".$invitation_code);    
                                }else{
                                    $time= date('Y-m-d H:i:s',time());
                                    $pmodel=  ActivityDetail::model()->findAll("is_float=1 and start<='".$time."' and end>='".$time."'");                                     
                                }
//                                $time= date('Y-m-d H:i:s',time());
//                                $pmodel=  ActivityDetail::model()->findAll("is_float=1 and start<='".$time."' and end>='".$time."'"); 
                                ?>
                                <select style="width:120px;"  onchange="ajaxptime()"  name="Party[ad_id]" id="Party_ad_id" >
                                  
                                 </select>
                                
                              

                            </div>
                        </div>
                  </div>
                   
                  
                  
                 
                  
                  <div class='ub top'>
                             <div class='ub '>
                                 <div>上车地点选择（单选）<span class="font12">*暂不接受自驾游</span></div>
                             </div>
                  </div>
                  
                  <div class="ub ub-ac top" style="padding-right:2em;">
                    <div style="background-color: #fdf8f2;border: 1px #f5956d solid; border-radius:5px;width: 100%">
                        <div class="ub-ver" style="margin:0em 1em 1em 1em;" id="postion">
                          
                            <div style=" text-align: center;padding-top:2em;padding-bottom: 1em" >
                            请选择体验时间
                            </div>
                              
                        </div>

                    </div>
                   </div>
                   <div class="errorMessage" id="Party_ad_id_em_" ></div>
                   <div class="errorMessage" id="Party_line_id_em_" ></div>
                   <??>
                  
            <div class="ub-ver top">
                <div class="ub">  
                <div >推荐人手机号</div>
                <div class="ub-f1 " style="margin-left:1em">
                     <?php echo $form->textField($model,'recommend',array('class'=>'text','style'=>"width: 70%;")); ?>
                </div>
                </div>
                <div style="font-size:12px!important;">*如无推荐人，无需填写</div>
            </div>
                  
              </div>

           
              
              <div class="errorSummary" id="errorSummary">
                 
              </div>

              
            <div class="ub ub-pc top" style="margin-bottom: 2em;">
  
                <?php
                       echo CHtml::ajaxSubmitButton('提交信息', CHtml::normalizeUrl(array('index')), array(
                            
                           'beforeSend'=>'js:loadding()',       
                           'type' => 'POST',
                           'data' => 'js:jQuery(this).parents("form").serialize()+"&isAjaxRequest=1"',
                           'success' =>
                           'function(data){
                                    // alert(data);
                                   if(data==1){
                                        next(3);
                                        clear_list();
                                        $("#Party_next").val("100");
                                        close();
                                   }else if(data==2){
                                         close();
                                         location.href = "message";
                                   }else if(data==3){
                                         close();
                                         location.href = "mes";
                                   }
                                   else{
                                            clear_list();
                                            var d_t=eval("("+data+")");

                                            $.each(d_t,function(k,v){
                                                
                                                  $("#"+k+"_em_").html("<span>"+v+"</span>");
                                            });

                                            close();
                                   }
                              
                                  }'
                               ), array(
                            'id' => 'ajaxSubmit',
                            'name' => 'ajaxSubmit',
                            'class'=>'btn-1',
                            'style'=>'width:170px;height:32px;',
                           

                       ));
                       ?>

            </div>

          </div>


       
        <script>
            //点击量
            function click_rate(){
//                window.location.href="<?php echo Yii::app()->baseUrl?>/index.php/default/click";
                var url='<?php echo Yii::app()->baseUrl?>/index.php/default/click';
                 $.ajax({
                     type: 'POST',
                     url: url,
                     data: null,
                     dataType:'json',
                     success:function(data) {
                     }    
                   });
            }
            click_rate();
            var code_times=0;
            function clear_list(){
                    
                    $("#Party_username_em_").html("");
                    $("#Party_phone_em_").html("");
                    $("#Party_vcode_em_").html("");
                    
                    
                    $("#Party_company_em_").html("");

                    $("#Party_code_em_").html("");
                    
                    $("#Party_province_em_").html("");
                    $("#Party_city_em_").html("");
                    $("#Party_area_em_").html("");

                    $("#Party_address_em_").html("");
                    $("#Party_children_num_em_").html("");
                    $("#Party_ad_id_em_").html("");
                    $("#Party_line_id_em_").html("");
                    
                    $("#Children_username_em_").html("");
                    
 
            }
            
            function reg_sub()
            {

                document.getElementById("party-form").submit();
                
            }
            
            function clearc(){
                   $("#Party_children_num_em_").html("");
                  document.getElementById("addBtn").style.display="none";
                  document.getElementById("ch_list").innerHTML='';
                  document.getElementById("Party_children_num").value="";
            }
            var d_id=1;
//            addList();    
            addListDefault();
            function addListDefault(){

                     document.getElementById("addBtn").style.display="block";
                     var div= document.createElement("div");          
                     var temp=' <div class="ub top">'+
                        '<div class="ub ub-ac" >'+
                           ' <div class="font12">姓名</div>'+
                           ' <div  style="margin-left:5px;" ><?php echo $form->textField($cmodel,'username[]',array('class'=>'text','style'=>"width:60px;font-size: 12px;")); ?></div>'+
                       ' </div>'+
                      ' <div class="ub  ub-ac" style="margin-left:0.5em">'+
                            '<div class="font12">性别</div>'+
                            '<div  style="margin-left:5px;" > <select style="width:50px;" name="Children[sex][]" id="Children_sex" ><option>男</option><option>女</option></select></div>'+
                        '</div>'+
                         '<div class="ub  ub-ac" style="margin-left:0.5em">'+
                            '<div class="font12">年龄</div>'+
                            '<div  style="margin-left:5px;" > <select  name="Children[age][]" id="Children_age" style="width:50px;">'+
                                <?php for($i=1;$i<17;$i++){?>    
                                '<option>'+<?php echo $i?>+'</option>'+
                                <?php }?>
                            '</select></div>'+
                        '</div>'+
                        '</div>'+
                      '<div class="ub top">'+
                           ' <div class="ub ub-ac" >'+
                                '<div class="font12">年级</div>'+
                                '<div  style="margin-left:5px;" ><?php echo $form->textField($cmodel,'grade[]',array('class'=>'text','style'=>"width:40px;font-size: 12px;")); ?></div>'+
                           ' </div>'+
                           '<div class="ub  ub-ac" style="margin-left:0.5em">'+
                               ' <div class="font12">学校</div>'+
                                '<div  style="margin-left:5px;" ><?php echo $form->textField($cmodel,'school[]',array('class'=>'text','style'=>"width:160px;font-size: 12px;")); ?></div>'+
                           ' </div> '+
                        '</div>';
                    div.innerHTML=temp;
                    //document.getElementById("ch_list").innerHTML= temp;
                    document.getElementById("ch_list").appendChild(div);
            }            
            function addList(){

                     document.getElementById("addBtn").style.display="block";
                     var div= document.createElement("div");          
                     var temp=' <div style="text-align: right;margin-bottom: -1.7em;" ><image onclick="clear_div('+d_id+')" style="text-align: right;width:1.5em;"src=" <?php echo Yii::app()->baseUrl?>/images/del.png" /> </div><div class="ub top" style="margin-left:1em">'+
                        '<div class="ub ub-ac" >'+
                           ' <div class="font12">姓名</div>'+
                           ' <div  style="margin-left:5px;" ><?php echo $form->textField($cmodel,'username[]',array('class'=>'text','style'=>"width:60px;font-size: 12px;")); ?></div>'+
                       ' </div>'+
                      ' <div class="ub  ub-ac" style="margin-left:0.5em">'+
                            '<div class="font12">性别</div>'+
                            '<div  style="margin-left:5px;" > <select style="width:50px;" name="Children[sex][]" id="Children_sex" ><option>男</option><option>女</option></select></div>'+
                        '</div>'+
                         '<div class="ub  ub-ac" style="margin-left:0.5em">'+
                            '<div class="font12">年龄</div>'+
                            '<div  style="margin-left:5px;" > <select  name="Children[age][]" id="Children_age" style="width:50px;">'+
                                <?php for($i=1;$i<17;$i++){?>    
                                '<option>'+<?php echo $i?>+'</option>'+
                                <?php }?>
                            '</select></div>'+
                        '</div>'+
                        '</div>'+
                      '<div class="ub top" style="margin-left:1em">'+
                           ' <div class="ub ub-ac" style="margin-bottom:1em;" >'+
                                '<div class="font12">年级</div>'+
                                '<div  style="margin-left:5px;" ><?php echo $form->textField($cmodel,'grade[]',array('class'=>'text','style'=>"width:40px;font-size: 12px;")); ?></div>'+
                           ' </div>'+
                           '<div class="ub  ub-ac" style="margin-left:0.5em;margin-bottom:1em;">'+
                               ' <div class="font12">学校</div>'+
                                '<div  style="margin-left:5px;" ><?php echo $form->textField($cmodel,'school[]',array('class'=>'text','style'=>"width:160px;font-size: 12px;")); ?></div>'+
                           ' </div> '+
                        '</div>';
                    div.innerHTML=temp;
                    div.id='add_div'+d_id;
                    div.style.background="#f4e7d4"; 
                    div.className="div_filter"
                    d_id+=1;
                    //document.getElementById("ch_list").innerHTML= temp;
                    document.getElementById("ch_list").appendChild(div);
            }
            function clear_div(id){
                   $("#add_div"+id).html("");
                   $("#add_div"+id).remove();
            }
 
            
          
            function smspost(){
                
                regPartton=/1[3-8]+\d{9}/;
                
                if(!regPartton.test($('#Party_phone').val())){
                         alert('请输入有效的11位手机号');
                        return;
                    }
//                    alert(code_times);
//                    code_times++;
//                    return;
                settime();    

                
                if($('#Party_phone').val().length==11&& !isNaN($('#Party_phone').val())){
                    var url='<?php echo Yii::app()->baseUrl?>/index.php/default/sms/'+$('#Party_phone').val();
                     $.ajax({
                         type: 'POST',
                         url: url,
                         data: {"code_times":code_times},
                         dataType:'json',
                         success:function(data) {
                            if(data==2){
                                alert("该手机号已经报名了本次活动");
                            }else{
                                if(code_times<=0){
                                    code_times++;
                                }
                                alert("请注意查收您的验证码");
//                                $('#click_post').attr("disabled","disabled"); 
                            }
                         }    
                       });
                  }else{
                      alert('请输入有效的手机号');
                  }
            }
            ajaxptime();
           function ajaxptime(){
       
            
            if($("#Party_ptime_id  option:selected").val()!=""){
               
             var url="<?php echo Yii::app()->createUrl('default/line') ?>/"+$("#Party_ad_id  option:selected").val();
           
           
            jQuery.ajax({'type':'POST','url':url,'success':function(data){
                                                   var d_t=eval("("+data+")");
                                                       var temp="";
                                                        for(var i=0;i<d_t.length;i++){

                                                             temp+='<div class="ub" style="margin-top:1em;">'+
                                                                        '<div>'+
                                                                            '<label class="ui-radio" for="radio">'+
                                                                              '<input type="radio" value="'+d_t[i].id+'" name="Party[line_id]" id="Party_line_id_'+i+'">'+
                                                                            '</label>'+
                                                                        '</div>'+
                                                                        '<div class="ub-f1">'+
                                                                            '<div>'+d_t[i]['position']['address']+'</div>'+
                                                                            '<div class="font12">乘车时间－'+d_t[i].go_time+'</div>'+
                                                                       '</div>'+
                                                                   '</div>';

                                                        }
                                                        $("#postion").html(temp); 
                                                       // alert(temp);
                                                          
                                                        
                                                    },'cache':false,'data':jQuery(this).parents("form").serialize()});return false;
                                                   
            }else{
            
                    var temp='<div style=" text-align: center;padding-top:2em;padding-bottom: 1em" >'+
                            '请选择体验时间'+
                            '</div>';
                     $("#postion").html(temp); 
            }
       
                 }
            //团体报名确认
            function ajaxtuanti(){
                if($("#invitation_code").val()!=""){
                    var url="<?php echo Yii::app()->createUrl('default/tuanti') ?>/"+$("#invitation_code").val();
                    jQuery.ajax({'type':'POST','url':url,'success':function(data){
                            if(data>0){
                                document.getElementById("tuanti_error_empt").style.display="none";  
                                next(2);
                            }else if(data==0){
                                alert("邀请码输入错误，请重新输入！如您是个人用户，请选择个人报名");
                            }else if(data==-1){
                                alert("报名时间结束！");
                            }else{
                                alert("报名已满！");
                            }
                        },'cache':false,'data':jQuery(this).parents("form").serialize()});return false;
//                    $.ajax({
//                        type: 'POST',
//                        url: url,
//                        data: null,
//                        dataType:'json',
//                        success:function(data) {
//                            if(data>0){
//                                alert("该手机号已经报名了本次活动");
//                            }else{
//                                alert("邀请码输入错误，请重新输入！如您是个人用户，请选择个人报名");
//                            }
//                        }    
//                    });                    
                }else{
                    document.getElementById("tuanti_error_empt").style.display="block"                
                }
            }
            
            
            function ajaxPartyTime(){
               var url="<?php echo Yii::app()->createUrl('default/partyTime') ?>";

                jQuery.ajax({'type':'POST','url':url,'success':function(data){
                     var d_t=eval("("+data+")");
                     var temp="";
                     for(var i=0;i<d_t.length;i++){
                        var time=d_t[i].begins;
                        temp+="<option value="+d_t[i].id+"> "+time.substring(0,10)+"</option>"
                     }        
                     document.getElementById("Party_ad_id").innerHTML=temp;
                     ajaxptime();
                        
                },'cache':false,'data':jQuery(this).parents("form").serialize()});return false;
 
             }
            
            //个人报名
            function geren(){
                    var url="<?php echo Yii::app()->createUrl('default/geren') ?>";
                    jQuery.ajax({'type':'POST','url':url,'success':function(data){
                            next(2);                          
                        },'cache':false,'data':jQuery(this).parents("form").serialize()});return false;                
            }
            //afterValidate     
            function loadding(){
                ajaxPartyTime();
                layer.load(0, {shade: [0.1,"#070707"] });
                return false;
            } 
            
            function close(){
            layer.closeAll(); //疯狂模式，关闭所有层
            } 

            var wait=45;  
            function settime(o){ 
                  var o=document.getElementById("click_post");
                    if (wait == 0) {  
                        o.removeAttribute("disabled");            
                        o.value="获取验证码";  
                        wait = 45;  
                    }else {  
                        o.setAttribute("disabled", true);  
                        o.value="重新发送(" + wait + ")";  
                        wait--;  
                        setTimeout(function(){  
                            settime(o)  
                        },  
                        1000)  
                    }  
                } 
            

            
        </script>

 
  <?php $this->endWidget(); ?>
    </body>
</html>
